DevForce Help Reference
Sum<TSource>(IEntityScalarQuery<TSource>) Method
Example 


Computes the sum of a sequence of numeric values.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Function Sum(Of TSource)( _
   ByVal source As IEntityScalarQuery(Of TSource) _
) As Task(Of TSource)
'Usage
 
Dim source As IEntityScalarQuery(Of TSource)
Dim value As Task(Of TSource)
 
value = EntityScalarAsyncExtensions.Sum(Of TSource)(source)

Parameters

source

Type Parameters

TSource
Example
public async void AsyncSum() {
   var sumFreight = await _entityManager.OrderSummaries.Select(o => o.Freight).AsScalarAsync().Sum();
 }
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityScalarAsyncExtensions Class
EntityScalarAsyncExtensions Members
Overload List

Send Feedback